<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>canvas 绘制函数</title>
        <style>
            * {
                margin: 0;
                padding: 0;
            }
            html, body {
                width: 100%;
                height: 100%;
            }
            #canvas {
                margin: 50px;
                display: block;
                width: 800px;
                height: 800px;
                border: 1px solid;
            }
        </style>
    </head>
    <body>
        <canvas id="canvas" width="800" height="800"></canvas>
        <script type="module" lang="ts">
            import { FnApp } from './src/main';

            const canvas = document.getElementById('canvas');
            const app = new FnApp(canvas, {
                // leftX: -10,
                // rightX: -10
                gridCount: 20
            });
            app.addFn(x => 1 / x, 'orange');
            app.addFn(x => x * x, 'cyan');
            app.addFn(x => Math.log(x), 'pink');
            app.addFn(x => Math.sin(x), 'green');
            app.addFn(x => Math.sqrt(x), 'blue');
            app.draw();
            // app.drawAnimate();
            window.app = app;
        </script>
    </body>
</html>
